package com.youmeek.ssm.module.category.service.impl;

import com.youmeek.ssm.module.category.mapper.ITaxCategoryMapper;
import com.youmeek.ssm.module.category.model.TaxCategory;
import com.youmeek.ssm.module.category.service.ITaxCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service
public class TaxCategroyServiceImpl implements ITaxCategoryService {

    @Resource
    ITaxCategoryMapper taxCategoryMapper;

    @Override
    public TaxCategory selectByPrimaryKey(String categoryId) {
        return taxCategoryMapper.selectByPrimaryKey(categoryId);
    }

    @Override
    public TaxCategory selectTaxCategoryByMergeCoding(String mergeCoding) {
        return taxCategoryMapper.selectTaxCategoryByMergeCoding(mergeCoding);
    }

    @Override
    public TaxCategory selectByCode(String coding) {
        return taxCategoryMapper.selectByCode(coding);
    }

    @Override
    public Map<String, TaxCategory> getAllTaxCategory() {
        return taxCategoryMapper.selectAllTaxCategory();
    }

    @Override
    public TaxCategory saveTaxcategory(TaxCategory taxCategory) {
        taxCategory.setCategoryId("1");
        taxCategoryMapper.insert(taxCategory);
        return taxCategory;
    }

    @Override
    public TaxCategory selectByCopyId(String id) {
        return taxCategoryMapper.selectByCopyId(id);
    }
}
